home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / PCTAGS15.ARJ / VIRUSCRC.H < prev    next >
C/C++ Source or Header  |  1991-10-05  |  1KB  |  50 lines

  1. /*
  2. VIRUSCRC.H
  3.  
  4. Kevin Dean
  5. Fairview Mall P.O. Box 55074
  6. 1800 Sheppard Avenue East
  7. Willowdale, Ontario
  8. CANADA    M2J 5B9
  9. CompuServe ID: 76336,3114
  10.  
  11. March 24, 1991
  12.  
  13.         This is the interface to the anti-virus CRC check in VALIDCRC.C
  14.  
  15.         This code is public domain.
  16. */
  17.  
  18.  
  19. typedef
  20. unsigned long crc32_t;
  21.  
  22. union filecrc {
  23.     char searchstr[8];          /* String to search for. */
  24.  
  25.     struct {
  26.         crc32_t polynomial;     /* Polynomial for this file. */
  27.         crc32_t crc;            /* Calculated CRC for this file. */
  28.     } x;
  29. };
  30.  
  31.  
  32. extern const union filecrc _viruscrc;
  33.  
  34.  
  35. /* CRC validation return codes. */
  36. enum {
  37.     CRC_VALID,                  /* CRC is valid. */
  38.     CRC_INVALID,                /* CRC is invalid. */
  39.     CRC_ISZERO,                 /* CRC polynomial has been reset to zero. */
  40.     CRC_NOMEM,                  /* No memory for data buffer. */
  41.     CRC_FILEERR                 /* Program file not found. */
  42. };
  43.  
  44.  
  45. int validatecrc(const char *progname);
  46.  
  47.  
  48. /* isvalidcrc() is declared to maintain compatibility with earlier releases. */
  49. #define isvalidcrc(progname)  (validatecrc(progname) == CRC_VALID)
  50.